Solving 10385 - Duathlon (Ternary search)
[andmenj-acm.git] / 10302 - Summation of polynomials / a.cpp
blob31c2ebb5d81084f951df009f9aa89c3014fa7be7
1 /*
2 Sebastian Arcila Valenzuela
3 sebastianarcila@gmail.com
4 2009
5 @(#)TEMPLATE.c.tpl
6 */
7 #include <stdio.h>
8 typedef unsigned long long ull;
9 int main()
11 for(ull x,ans;scanf("%llu",&x) == 1; printf("%llu\n",ans*ans))
12 if((x&1))
13 ans = (x+1)/2*x;
14 else
15 ans = x/2*(x+1);
17 return 0;